<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>xml-dom-解析xml</title>
		<script type="text/javascript">
		function jxxml()
{try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    xmlDoc=document.implementation.createDocument("","",null);
    }
  catch(e) {alert(e.message)}
  }
try 
  {
  xmlDoc.async=false;
  alert(document.getElementById('fil1').value);
  xmlDoc.load(document.getElementById('fil1').value);
  document.write("xmlDoc is loaded, ready for use");
  }
catch(e) {alert(e.message)}
}
</script>


	</head>
	<body>
	
<input type="file" id="fil1" />
<input type="button" onclick="jxxml()" value="解析xml文件" />
	</body>
</html>
